package p2pcdnsim.cdn;

import p2pcdnsim.network.ApplicationProcess;
import desmoj.core.simulator.Model;

public abstract class Surrogate extends ApplicationProcess {

	protected CDN cdn;
	protected String id;
	
	public Surrogate(Model owner, String name, CDN cdn) {
		super(owner, name);
		this.id = name;
		this.cdn = cdn;
	}

	@Override
	public boolean equals(Object obj) {
		if(!(obj instanceof Surrogate)) return false;
		Surrogate surrogate = (Surrogate)obj;
		return id.equals(surrogate.id);
	}
	
	public String toString() {
		return id;
	}

	public int hashCode() {
		return id.hashCode();
	}

	public String getId() {
		return id;
	}
}
